package com.bolt.support.spring.jpa.entity;


import com.bolt.common.utils.StrUtil;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by Administrator on 2017/9/26.
 */
@Access(AccessType.FIELD)
@MappedSuperclass
public abstract class BaseEntity<ID extends Serializable> extends PersistableEntity<ID> {

    @Version
    @Column(name = "VERSION_NO", nullable = false)
    private Integer versionNO = 0;

    public Integer getVersionNO() {
        return versionNO;
    }

    public void setVersionNO(Integer versionNO) {
        this.versionNO = versionNO;
    }

    @Override
    public String toString() {
        return StrUtil.toString(this);
    }


}
